package com.bwie.controller;
import com.bwie.pojo.Brand;
import com.bwie.service.BrandService;
import com.bwie.service.Impl.BrandServiceImpl;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* 品牌表(tb_brand)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/prod/brand")
public class BrandController {
/**
* 服务对象
*/
    @Autowired
    private BrandService brandService;

    /**
     * 品牌列表
     * @param pageInfoVo
     * @return
     */
    @PostMapping(value = "/getBrandList")
    public R getBrandList(
            @RequestBody PageInfoVo pageInfoVo
            ){
        return brandService.getBrandList(pageInfoVo);
    }

    /**
     * 添加品牌
     * @param brand
     * @return
     */
    @PostMapping(value = "/addBrand")
    public R addBrand(
        @RequestBody Brand brand
    ){
        return brandService.addBrand(brand);
    }

    /**
     * 修改
     * @param brand
     * @return
     */
    @PostMapping(value = "/updateBrand")
    public R updateBrand(
        @RequestBody Brand brand
    ){
        return brandService.updateBrand(brand);
    }

    /**
     * 查询品牌名称
     * @param
     * @return
     */
    @PostMapping(value = "/getBrand")
    public R getBrand(){
        return brandService.getBrand();
    }
}
